[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
PROMPTSTR IEXP1,VAR,IEXP2,SEXP,IEXP3
Function
Prompt the user for input using a prompt from the PCBTEXT file in a
specific format.
Syntax
PROMPTSTR prompt,var,len,valid,flags
prompt - An integer expression with the prompt number from PCBTEXT
to display to the user.
var - The variable in which to store the user's input.
len - An integer expression with maximum length (1-256) of text to
input.
valid - A string expression with the valid characters that the
user may enter.
flags - An integer expression with flags to modify how the
statement works.
Remarks
This statement will accept a string of input from the user, up to the
length defined. The prompt parameter will be used to find the prompt
from PCBTEXT (which includes the prompt color) to display to the user.
Only characters found in the valid parameter will be accepted. However,
the flags parameter may affect how the prompt is displayed and the valid
characters that are accepted. Individual flags may be added together
as needed.
Several functions exist to easily specify commonly used valid character
masks. They are:
MASK_ALNUM() - A through Z, a through z, and 0 through 9
MASK_ALPHA() - A through Z and a through z
MASK_ASCII() - Space (ASCII 32) through tilde (ASCII 126)
MASK_FILE() - Legal file name characters (DOS)
MASK_NUM() - 0 through 9
MASK_PATH() - Legal path names (DOS)
MASK_PWD() - Legal password characters
Defined flag values are:
AUTO -Auto press enter after 20 seconds of no user input
DEFS -Use default values
ECHODOTS -Echo dots instead of user input
ERASELINE -Erase the current line when user presses enter
FIELDLEN -Displays "()" to show input field width if ANSI enabled
GUIDE -Displays "()" for FIELDLEN if ANSI not enabled
HIGHASCII -Allow high ascii characters
LFAFTER -Send an extra line feed after user presses enter
LFBEFORE -Send an extra line feed before prompt display
NEWLINE -Send a line feed after user presses enter
NOCLEAR -Don't clear field at first keypress regardless of ANSI
STACKED -Allow semi-colons and spaces to be input
UPCASE -Force user input to upper case
WORDWRAP -Save the text at the end of the line
YESNO -Only allow international yes/no responses
To use these flag constants simply add the ones you need together.
Examples
BOOLEAN b
DATE d
INTEGER i
MONEY m
STRING s
TIME t
' NOTE: prompt 706 is used here for all statements;
' you may use any prompt you wish
PROMPTSTR 706,b,1,"10",LFBEFORE+NEWLINE
PROMPTSTR 706,d,8,"0123456789-",NEWLINE+NOCLEAR
PROMPTSTR 706,i,20,MASK_NUM(),NEWLINE
PROMPTSTR 706,m,9,MASK_NUM()+".",NEWLINE+DEFS+FIELDLEN
PROMPTSTR 706,s,63,MASK_ASCII(),NEWLINE+FIELDLEN+GUIDE
PROMPTSTR 706,t,5,"0123456789"+":",NEWLINE+LFAFTER
PRINTLN b," ",d," ",i
PRINTLN m," ",s," ",t
See Also:
INPUT
INPUT...
INPUTSTR
INPUTTEXT
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson